package cn.coisini.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author xiangshaw
 * Description: 用户信息
 */
@Tag(name = "用户信息")
@Getter
@Setter
public class UserDto implements Serializable {
    @Schema(description = "用户id")
    @NotBlank(message = "用户id不能为空")
    private String id;
    @Schema(description = "用户名 字符串参数不为空（长度大于 0，不是纯空格字符串）")
    @NotBlank(message = "用户名不能为空")
    private String username;
    @Schema(description = "密码")
    @NotBlank(message = "密码不能为空")
    private String password;
    @Schema(description = "昵称(^字符串起始位置、\\\\S 非空字符、{1,10} 字符长度且不包含空白字符、$字符串结束位置)")
    @Pattern(regexp = "^\\S{1,10}$")
    private String nickName;
    @Schema(description = "描述")
    private String description;
    @Schema(description = "头像地址")
    private String avatar;
    @Schema(description = "手机号")
    private String phone;
    @Schema(description = "邮箱")
    @Email
    private String email;
    @Schema(description = "状态（0正常、1锁定、2封禁）")
    private Integer status;
    @Schema(description = "登录时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime loginTime;
    @Schema(description = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime createTime;
    @Schema(description = "更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime updateTime;

    @Schema(description = "验证码")
    private String captcha;
    @Schema(description = "唯一标识")
    private String uuid = "";
}
